home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Segmentation Fault ???
- Date: 10 Mar 96 20:26:58 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.826489618@rscernix>
- References: <4hsa7i$en3@wraith.its.uow.edu.au> <4huis1$cm2@ccshst05.cs.uoguelph.ca>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4huis1$cm2@ccshst05.cs.uoguelph.ca> thay@uoguelph.ca (Toby K Hay) writes:
-
- >Theeradech Paopeng (tp02@wraith.its.uow.edu.au) wrote:
- >: Hello to all.
- >: I'm here to ask you guys about the "Segmentation Fault".
- >: I was run my program on Unix and I got run_time_error say that "Segmentation
- >: Fault". I really no idea how to fix that problem. One more thing I have to tell to fix that problem. One more thing I have to tell
-
- This is a typical case of doing bad things with pointers, most likely
- dereferencing an uninitialized pointer.
-
- >This is a coincidence. I moved a running ANSI C program from Turbo C on
- >my PC to a multi-processor Silicon Graphics UNIX machine yesterday (my
- >first try at running C on anything but a PC) and got the same error.
- >Retrying invoked a "Bus Error". I assumed that my abysmal ingnorance of
- >UNIX was causing me to omit essential switches from the command line or
- >something of that nature, and resolved to ask on an SGI newsgroup, and to
- >ask the system administrator for guidance after the weekend.
-
- Another case of doing bad things with pointers. On PC, there are no
- alignment restrictions, on most other architectures an attempt to access
- data which is not properly aligned will cause an Bus Error and a coredump.
- Learn how to use a debugger to analize a coredump and you'll find out
- your problem instantly.
-
- There is nothing SGI-specific in your problem and no compiler switches
- will help. You have to fix your program.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-